/// @tags: Probablity
#include <cstdio>
#include <iomanip>
#include <iostream>

using namespace std;

namespace BlueQuantum {

int const N = 5e5 + 5;

struct Edge {
  int v, nxt;
} e[N << 1];

int n, e_cnt, heads[N];
int dep[N];

inline void add(int u, int v) {
  e[++e_cnt].v = v, e[e_cnt].nxt = heads[u], heads[u] = e_cnt;
}

void dfs(int u, int fa) {
  for (int i = heads[u]; i; i = e[i].nxt)
    if (e[i].v != fa) dep[e[i].v] = dep[u] + 1, dfs(e[i].v, u);
}

inline int main() {
  cin >> n;
  for (int i = 1, a, b; i < n; ++i) {
    cin >> a >> b;
    add(a, b), add(b, a);
  }
  dep[1] = 1;
  dfs(1, 1);
  double ans = 0;
  for (int i = 1; i <= n; ++i) ans += 1.0 / dep[i];
  cout << fixed << setprecision(7) << ans;
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("CF280C Game on Tree.in", "r", stdin);
  freopen("CF280C Game on Tree.out", "w", stdout);
#endif
#endif

  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
